<!DOCTYPE html>
<html>
<head>
    <title>登录页面</title>
    <meta charset="UTF-8">
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script type="text/javascript">
        var obj = {};
        obj.receiverId = 12;
        obj.orderItems = [];
        obj.orderItems.push({
            "productId": 32,
            "shopId": 1,
            "quantity": 1
        });
        obj.orderItems.push({
            "productId": 33,
            "shopId": 2,
            "quantity": 1
        });
        var obj1 = {
            "context": "哈哈哈哈",
            "commentId": 355
        };
        var obj2 = {
            userId: 46,
            productIds: [32, 60]
        };
        // obj2.productIds.push(10);
        // var url = "http://localhost:9092/order/v1.0.0/confirmOrder";
        var url = "http://localhost:8686/user/selectPage_v1";

        // var url = "http://localhost:9092/order/v1.0.0/appendOrderCommentsByMinAPP";

        function myReload() {
            // console.log($.param(obj2, true));
            //通过ajax一个属性traditional:true来指定参数序列化时，不做深度序列化
            $.ajax({
                type: 'GET',
                url: url,
                data: obj2,
                dataType: 'json',
                traditional: true,//通过ajax一个属性traditional:true来指定参数序列化时，不做深度序列化
                timeout: 60000,
                // processData: false,
                contentType: 'application/json',
                success: function (resData, status, xhr) {
                    console.log(resData)
                },
                error: function (xhr, errorType, error) {
                    console(xhr, errorType, error);
                }
            })
            // document.getElementById("CreateCheckCode").src = document.getElementById("CreateCheckCode").src + "?nocache=" + new Date().getTime();
        }

        function myReload_1() {
            // console.log($.param(obj2, true));
            //通过JSON.stringify()将参数作为数组传递到后台，后台不能通过获取参数名的方式获取参数，需要通过inputstream流来读取参数。
            $.ajax({
                type: 'POST',
                url: url,
                data: JSON.stringify(obj2),
                dataType: 'json',
                timeout: 60000,
                processData: false,
                contentType: 'application/json',
                success: function (resData, status, xhr) {
                    console.log(resData)
                },
                error: function (xhr, errorType, error) {
                    console(xhr, errorType, error);
                }
            })
            // document.getElementById("CreateCheckCode").src = document.getElementById("CreateCheckCode").src + "?nocache=" + new Date().getTime();
        }
    </script>

</head>

<body>
<form action="loginServlet" method="get">
    <p class="font">
        验证码：<input type="text" name="checkCode" style="width:80px;height:35px;">
        <img src="/pictureCheckCode" id="CreateCheckCode" align="middle" style="margin-top:-10px;"> <br>

    </p>

    <br><input type="submit" value="提交"
               class="font" style="width:240px;height:35px;background:#f19e28">

</form>
<button href="" onclick="myReload()" style="font-size:12px;color:red;margin-left:156px;">看不清,换一个</button>
</body>
</html>